<!DOCTYPE html>
<html>
<head>
<div th:replace="common/common_resource :: common_css"></div>
<title th:text="${application.shop_name} +' | 资源维护'"></title>
</head>
<body class="hold-transition skin-blue sidebar-mini" >
	<div class="wrapper">
		<div th:replace="common/common_h5 :: loginAndLogout"></div>
		<div th:replace="common/common_h5 :: upload_image"></div>
		<div th:replace="common/common_h5 :: left_menu"></div>
		<div class="content-wrapper">
			<section class="content">
				<div class="row">
					<div class="col-xs-12">
						<div class="box">
							<div class="box-header">
								<div class="row">
									<div class="col-xs-4">
										<span>
											<button type="button" id="add_dep" name="cleanAll" class="btn  btn-warning " style="margin-bottom: 10px;" data-toggle="modal" data-target="#resources_add_and_update">
													<i class="fa fa-plus">添加资源</i>
											</button>
										</span>
										<div class="modal fade " id="resources_add_and_update" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
											<div class="modal-dialog ">
												<div class="modal-content">
													<div class="modal-header bg-blue">
														<button type="button" name="cleanAll" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
														<h4 class="modal-title" id="myModalLabel">添加/修改资源</h4>
													</div>
													<div class="modal-body">
														<form role="form" id="formresources" th:action="${#httpServletRequest.getContextPath()}+'/resources/insertAndUpdate'" method="post">
															<input type="hidden" name="menuUuid" th:value="${menuUuid!=null}?${menuUuid}:'740'">
															<div class="box-body">
																<div class="form-group">
																	<label for="role_name">资源名称</label>
																		<input type="hidden" name="resUuid" id="resUuid" th:value="${dataBean!=null? dataBean.resUuid:''}" />
																		<input type="text" name="resName" class="form-control" th:value="${dataBean!=null? dataBean.resName:''}" id="resName" placeholder="资源名称" />
																</div>
																<div class="form-group">
																	<label for="role_code">资源路径</label>
																	<input type="text" class="form-control" th:value="${dataBean!=null? dataBean.resUrl:''}"  name="resUrl" id="resUrl" placeholder="资源路径" />
																</div>
															</div>
															<div class="modal-footer">
																<div class="row">
																	<div class="col-xs-6 text-center">
																		<button type="reset" class="btn btn-warning" name="cleanAll">清&nbsp;&nbsp;&nbsp;&nbsp;除</button>
																	</div>
																	<div class="col-xs-6 text-center">
																		<button type="submit" class="btn btn-primary">提&nbsp;&nbsp;&nbsp;&nbsp;交</button>
																	</div>
																</div>
															</div>
														</form>
													</div>
												</div>
											</div>
										</div>
									</div>
									<div class="col-xs-4">
										<h3 class="box-title">资源数据列表</h3>
									</div>
									<div class="col-xs-4"></div>
								</div>
							</div>
							<div class="box-body table-responsive">
								<table id="example2" class="table table-bordered table-striped">
									<thead>
										<tr class="bg-green ">
											<th>资源类别</th>
											<th>资源名称</th>
											<th>资源值</th>
											<th>是否可用</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody th:remove="all-but-first">
										<tr th:class="${resstar.index % 2 ==0}? '' : 'bg-gray'" th:each="res,resstar:${resList}">
											<td>URL访问</td>
											<td th:text="${res.resName}"></td>
											<td th:text="${res.resUrl}"></td>
											<td><i class="fa fa-circle text-success">可用</i></td>
											<td>&nbsp;&nbsp;&nbsp;&nbsp;
												<a href="javascript:void(0);" name="show" th:id="${res.resUuid}" class="fa fa-file btn btn-primary">详情</a>&nbsp;&nbsp;&nbsp;&nbsp;
												<a href="javascript:void(0);" th:id="${res.resUuid}"  data-toggle="tooltip"  data-placement="rigth" data-original-title="删除后将无法恢复"  class="fa fa-trash btn btn-primary example5-3-2" >废除</a>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
			</section>
		</div>
		<div th:replace="common/common_h5 :: down_foot"></div>
		<div th:replace="common/common_h5 :: down_sidebar"></div>
		<div th:replace="common/common_h5 :: error_message"></div>
		<div class="control-sidebar-bg"></div>
		<div th:replace="common/common_resource :: common_js"></div>
		<script th:src="@{/admin_js/basics/resources_list.js}"></script>
</body>
</html>
